#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QScriptValue>
#include <QNetworkReply>
#include <QNetworkAccessManager>

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = nullptr);
    ~Widget();

protected:
    void clearLabel();
    QString getAccessToken() const;
    QByteArray getblock(const QString &strUrl) const;
    QString getImageData(const QString& img) const;

private slots:
    void on_start_clicked();
    void on_open_clicked();
    void replyFinished(QNetworkReply* reply);

private:
    Ui::Widget* ui;
    QString imageFile;
    QNetworkAccessManager* manager;
};

#endif // WIDGET_H
